<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<h1>已经产生一个两位数</h1>
		<label>请猜一个数：</label>
		<input type="text" id="num"/>
		<input type="button" value="确定" onclick="guess()"/>
		<h1 id="jg"></h1>
		<script type="text/javascript">
			var realNumber=parseInt(Math.random()*100);
			var jg=document.getElementById("jg");
			function guess () {
				var num=document.getElementById("num").value;
				if(num==realNumber)
					jg.innerHTML="恭喜！猜对了";
				else if(num>realNumber)
					jg.innerHTML="大了！";
				else jg.innerHTML="小了";
			}
		</script>
	</body>
</html>
